package com.example.dem3;
/**
 * @program: orm
 * @description:
 * @author: 诸葛龙辰
 * @create: 2022-10-31 09:51
 **/
public class Ticket implements Runnable{
    private int tickets=100;
    @Override
    public void run(){
        while (true){
            if (tickets>0){
                System.out.println(Thread.currentThread().getName()+"卖了一张票,剩余:"+ --tickets);
            }else {
                break;
            }
        }
    }
}
